import java.io.Serializable;


public class IndexWordTile implements Serializable {
	String word;
	long pointWordTile;
	long hashval;
	int occurrence;
	int freq;
	
	IndexWordTile(String word, long pointWordTile,long hashval,int occurrence,int freq ){
		this.word = word;
		this.pointWordTile = pointWordTile;
		this.hashval = hashval;
		this.occurrence = occurrence;
		this.freq = freq;
	}
	public boolean equals(Object o){
		return word.equals(o);
		
	}
	
	public int hashCode(){
		return word.hashCode();
	}
	
	public void display(){
		System.out.println(word+" "+pointWordTile+" "+hashval+" "+occurrence);
	}
	void setOccurrence(int elements){
		this.occurrence = elements;
	}
	int getOccurrence(){
		return occurrence;
	}
	long getAddr(){
		return pointWordTile;
	}
	public int incrementFreq(){
		freq++;
		return freq;
	}
	public int getFreq(){
		return freq;
	}
}



class SpecialString implements Serializable{
	String sWord;
	int hash;
	
	SpecialString(String str){
		sWord = str;
		hash = hashCode();
	}
	public boolean equals(Object o){
		return sWord.equals(o.toString());
	}
	
	public int hashCode(){
		
		long h = 0;
	    int len = sWord.length();
	    for (int i = 0; i < len; i++) {
	        h =  5*h + sWord.charAt(i);
	    }
	    return (int)h;
	    
		//return sWord.hashCode();
	}
	public String toString(){
		return sWord;
	}
}
















